﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sushu
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int max = int.Parse(textBox1.Text);
            int min = int.Parse(textBox2.Text);
            ArrayList result=new ArrayList();
            string str = "";
            for (int i = min; i <= max; i++)
            {
                for (int j = 2; j < i; j++)
                {
                    if (i % j == 0)
                    {
                        break;
                    }
                    else if (j == i - 1)
                    {
                        result.Add(i);
                    }
                }
            }
            int temp=0;
            for (int i = 0; i < result.Count; i++)
            {
                str = str + result[i]+" ";
                temp++;
                if (temp == 10)
                {
                    str = str + "\r\n";
                    temp = 0;
                } 
            }
            label3.Text =str;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label3_Click(object sender, EventArgs e)
        {

        }
    }
}
